package com.scheduled.service;

import com.scheduled.pojo.ScheduledRequest;
import com.scheduled.pojo.dto.BaseResponseDTO;

import java.net.UnknownHostException;

/**
 * 定时任务服务
 *
 * @author : z_sz
 * @date : 2020-08-10 10:24
 **/
public interface ScheduledService {
    /**
     * 延迟执行
     * @param scheduledRequest 延迟执行实体
     * @return 操作结果
     * @throws UnknownHostException ip地址不存在异常
     */
    String delayExecute(ScheduledRequest scheduledRequest) throws UnknownHostException;

    /**
     * 延迟执行任务取消
     * @param id 任务id,任务唯一标识
     * @return 操作结果
     * @throws UnknownHostException ip地址不存在异常
     */
    BaseResponseDTO delayCancel(String id) throws UnknownHostException;
}
